perm filename JUMP.PAS[1,RWF] blob
sn#650538 filedate 1982-03-30 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 program jump(output)
C00004 ENDMK
Cā;
program jump(output);
var i,j,a,b,total,n:integer;
s6,s16:real;
p6,p16:array[-24:100] of real;
begin
for i:= -24 to -1 do
begin
p6[i]:=0;
p16[i]:=0;
end;
for n:=0 to 99 do
begin
s6:=0;
s16:=0;
for i:= 1 to 6 do
for j:= 1 to 6 do
begin
a:=min(i,j);
b:=i+j-a;
if i = j then total:=4*i
else total :=i+j;
if a=1 then
begin
if b=6 then
begin
s6:=s6+1.0;
s16:=s16+1.0;
end
else
begin
s6:=s6+p6[n-total];
s16:=s16+p6[n-total+1];
end
end
else
begin
if b=6 then
begin
s6:=s6+1.0;
s16:=s16+p16[n-total];
end
else
begin
s6:=s6+p6[n-total];
s16:=s16+p16[n-total];
end;
end;
end;
p6[n]:=s6/36.0;
p16[n]:=s16/36.0;
writeln(n,p6[n]:8:4,p16[n]:8:4);
end;
end.